import React, { Component } from 'react'
import './Details.css'
export default class Details extends Component<any, any> {
    run = () => {
        this.props.history.push('/Main/Leave/Mytime')
    }
    render() {
        return (
            <div>
                <h4>请假详情</h4>
                <div className='box1'>
                    <p className='txt1'>请假人：&nbsp;&nbsp;&nbsp;<span>{this.props.location.query.record.xm}</span></p>
                    <p className='txt1'>请假类型：&nbsp;&nbsp;&nbsp;<span>{this.props.location.query.record.caus}</span></p>
                    <p className='txt1'>请假时间：&nbsp;&nbsp;&nbsp;<span>{this.props.location.query.record.start} ~ {this.props.location.query.record.end}</span></p>
                    <p className='txt1'>申请时间：&nbsp;&nbsp;&nbsp;<span>{this.props.location.query.record.start}</span></p>
                    <p className='txt1'>请假原因：&nbsp;&nbsp;&nbsp;<span>{this.props.location.query.record.yy}</span></p>
                    <p className='txt1'>审批状态：&nbsp;&nbsp;&nbsp;{this.props.location.query.record.rove === '审批通过' ? (<span style={{ color: '#00CC33' }}>{this.props.location.query.record.rove}</span>) : (<span style={{ color: '#FF0000' }}>{this.props.location.query.record.rove}</span>)}</p>
                    <p className='txt1'>审批意见：&nbsp;&nbsp;&nbsp;<span>{this.props.location.query.record.suggest}</span></p>
                    <p className='txt1'>附件：&nbsp;&nbsp;&nbsp;<span>暂无</span></p>
                    <button className='run' onClick={this.run}>返回</button>
                    {this.props.location.query.record.rove === '审批通过' ? <div className='spyj' style={{ backgroundColor: '#00CC33' }}>
                        {this.props.location.query.record.rove}
                    </div> :
                        <div className='spyj' style={{ backgroundColor: '#FF0000' }}>
                            {this.props.location.query.record.rove}
                        </div>}

                </div>
            </div>
        )
    }
}   
